package main

import (
	"context"
	"fmt"
	"gbox-one-machine/discovery"
	"gbox-one-machine/utils"
)

func main() {
	ip, mac, err := utils.ExternalIP()
	if err != nil {
		//log.Logger.Errorf("GET LOCAL IP ERROR : %s", err)
		fmt.Println(err)
	}
	params := []string{fmt.Sprintf("mac=%s", mac), "type=onemachine"}
	s, err := discovery.Register(context.TODO(), "equipment", ip.String(), 34543, params)
	if err != nil {
		panic(err)
	}

	for {
		select {}
	}

	s.Shutdown()
}
